package com.atguigu.gmall.weball.controller;


import com.atguigu.gmall.feign.product.HelloFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;


/**
 * Field helloFeignClient in
 * com.atguigu.gmall.weball.controller.HelloController
 * required a bean of type 'com.atguigu.gmall.feign.product.HelloFeignClient'
 * that could not be found.
 */
@RestController
public class HelloController {

    @Autowired
    HelloFeignClient helloFeignClient;

    @GetMapping("/hellorpc")
    public String hellorpc(HttpSession session) {
        String hello = helloFeignClient.hello();
        session.setAttribute("aaa","bbb");
        return "rpc完成：" + hello;
    }

    @GetMapping("/hellotest")
    public String hellotest() {
        return "ok" ;
    }
}
